package org.ne.springboot.interceptor;

import io.minio.MinioClient;
import org.ne.springboot.pojo.MinioPojo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author wey
 * @date 2025/7/25 下午8:54 07
 **/

//配置

@Configuration
public class MinioConfig {

    @Autowired
    private MinioPojo minioPojo;
    @Bean
    public MinioClient minioClient(){

        return MinioClient.builder()
                .endpoint(minioPojo.getUrl())
                //传入url地址
                //传入用户名和密码
                .credentials(minioPojo.getUsername(), minioPojo.getPassword())
                .build();  //完成MinioClient的初始化
    }
}